﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Crm.Sdk;

namespace XrmLibrary.MsCrm4Adapter.Extensions
{
    public static class CrmDateTimeExtensions
    {
        public static DateTime? ToDateTime(this CrmDateTime crmDateTime)
        {
            DateTime dateTime;

            if (!DateTime.TryParse(crmDateTime.Value, out dateTime))
                return null;

            return dateTime;
        }
    }
}
